package cn.naughtior.shch.mobile.util;

public class ReplaceWithStar {
	public static String mobilePhoneReplace(String mobilePhone){
		char[] mp = mobilePhone.toCharArray();
		for(int i=3;i<7;i++){
			mp[i]='*';
		}
		return new String(mp);
	}
	public static String nameReplace(String name){
		char[] name_star = name.toCharArray();
		if(name_star.length==2){
			name_star[1]='*';
		}else if(name_star.length>2){
			for(int i=1;i<(name_star.length-1);i++){
				name_star[i]='*';
			}
		}
		return new String(name_star);
	}
	public static void main(String[] args) {
		System.out.println(mobilePhoneReplace("18817391644"));
		System.out.println(nameReplace(""));
		System.out.println(nameReplace("王豫宁"));
	}
}
